//发送查询列表的ajax请求
var tblist=document.querySelector('#tb-list')
getdata()
function getdata(){
    utils.fetch('./api/v1/shop/select.php').then(resp=>{
        // console.log(resp)
    if(resp.code===200){
    const{list}=resp.body
    let str=''
    // console.log(list)
    list.forEach((shop,index) => {
        // console.log(shop.id)
        str +=`<tr data-id="${shop.id}">
        <th>${index+1}</th>
        <th><span>${shop.name}</span>
            <input type="text">
        </th>
        <th><span>${shop.prise} </span>
            <input type="number" min="0">
        </th>
        <th><span>${shop.num}</span>
            <input type="number" min="0">
        </th>
        <th>
    <button class="btn btn-success">编辑</button>
    <button class="btn btn-danger btn-del">删除</button>
    <button class="btn btn-primary btn-ok">确认</button>
    <button class="btn btn-warning btn-no">取消</button>
        </th>
        </tr>`
        
    })
    // console.log(tblist)
    tblist.innerHTML=str
    
    }
 
    
    })
}















